<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../../inc/md5.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>帐号注册</title>
<meta name="keywords" content="帐号注册" />
<meta name="description" content="帐号注册" />
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<script language="javascript" type="text/javascript" src="/js/pd.js"></script>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.tabs.js"></script>
<script type="text/javascript">
//$(function(){
//	$('.reg_s_1').Tabs({
//		event:'click'
//	});
//});	
</script>
<script type="text/javascript"> 
 <!-- 
//将用户输入异步提交到服务器 
function ajaxSubmit(){ 
 //获取用户输入
<%if request.QueryString("typeid")="" then%> 
var mobile=document.formcn.mobile.value; 
var typeid=document.formcn.typeid.value; 
if (mobile=="")
{alert("手机号不能为空");
return false;
}
if(!checkcell(mobile)){
alert("手机号输入错误");
return false;
} 
<%else%>
var mobile=document.formcn.mail.value; 
var typeid=document.formcn.typeid.value; 
if (mobile=="")
{alert("邮箱不能为空");
return false;
}
if(!CheckEmail(mobile)){
alert("邮箱输入错误");
return false;
} 
<%end if%>
 //创建XMLHttpRequest对象 
var xmlhttp; 
 try{ 
 xmlhttp=new XMLHttpRequest(); 
 }catch(e){ 
 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
 } 
 //创建请求结果处理程序 
xmlhttp.onreadystatechange=function(){ 
 if (4==xmlhttp.readyState){ 
 if (200==xmlhttp.status){ 
 var date=xmlhttp.responseText; 
 addToList(date); 
 }else{ 
 alert("error"); 
 } 
 } 
 } 
 //打开连接，true表示异步提交 
xmlhttp.open("post", "/reg/mobile", true); 
 //当方法为post时需要如下设置http头 
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 
 //发送数据 
xmlhttp.send("mobile="+escape(mobile)+"&typeid="+escape(typeid)); 
alert("发送成功");
 } 
 //--> 
</script> 
<script>
function myjobchk(){
if (document.formcn.mail.value=="")
{alert("E-mail 不能为空");
document.formcn.mail.focus();
return false;
}
if(!CheckEmail(formcn.mail.value)){
alert("邮箱输入错误");
formcn.mail.focus();
return false;
}
if (document.formcn.username.value=="")
{alert("用户名不能为空");
document.formcn.username.focus();
return false;
}
if(formcn.username.value.length>12 || formcn.username.value.length<6){
alert("用户名长度不能大于12或小于6")
formcn.username.focus()
return(false)
}
<%if request.QueryString("typeid")="" then%>
if (document.formcn.mobile.value=="")
{alert("手机号不能为空");
document.formcn.mobile.focus();
return false;
}
if(!checkcell(formcn.mobile.value)){
alert("手机号输入错误");
formcn.mobile.focus();
return false;
}
<%end if%>
if (document.formcn.qq.value !=""){
if(!Checkshuzi(formcn.qq.value)){
alert("qq号输入错误");
formcn.qq.focus();
return false;
}}
if (document.formcn.wangwang.value !=""){
if(formcn.wangwang.value.length>20){
alert("旺旺输入错误")
formcn.username.focus()
return(false)
}}
if (document.formcn.password.value=="")
{alert("密码不能为空");
document.formcn.password.focus();
return false;
}
if(formcn.password.value.length>15 || formcn.password.value.length<6){
alert("密码长度不能大于15或小于6")
formcn.password.focus()
return(false)
}
if(formcn.password2.value=="" || formcn.password2.value!=formcn.password.value){
alert("两次输入密码不一致")
formcn.password2.focus()
return(false)
}
if (document.formcn.mobilecode.value=="")
{alert("验证码不能为空");
document.formcn.mobilecode.focus();
return false;
}
if(formcn.mobilecode.value.length>20){
alert("验证码输入错误")
formcn.mobilecode.focus()
return(false)
}
var chk = document.getElementById('isClause'); 
if(chk.checked){ 
// 提交 
}else{ 
alert("请接受网站使用条款")
formcn.isClause.focus()
return(false)
}           
return(true);
}
</script>











	
</head>
<body>

<!--#include file="../common/top.asp"-->

<div class="fullwidth bg2">
	<div class="place ">
		<a href="/">首页</a> &gt; 帐号注册
	</div>
</div>

<!--main-->
<div class="fullwidth bg1">
	<div class="main">
		<div class="clear20"></div>
		<div class="reg">
			<p class="reg_p_1"><span class="blue">账号注册</span> <font class="red">*</font>星标为必填选项</p>
			<div class="clear20"></div>
			
			<div class="reg_box reg_s_1">
            
				<ul class="tab_menu">
					<a href="/reg"><li class="<%if request.QueryString("typeid")="" then response.Write "current "%>reg_gn">大陆用户</li></a>
					<a href="?typeid=2"><li class="<%if request.QueryString("typeid")="2" then response.Write "current "%>reg_hw">海外用户</li></a>
				</ul>
				<div class="tab_box">
                
                
                
                    <%if request.QueryString("typeid")="" then%>
					<div>
						<div class="clear20"></div>
                        <form name="formcn" method="post" action="" onSubmit="return myjobchk();" class="reg_form_1">
							<dl>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;邮箱帐号：</span><input name="mail" type="text" class="text reg_ico_1" id="mail" value="" placeholder="请输入常用邮箱，可用作登录帐号" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;用户名：</span><input name="username" type="text" class="text reg_ico_2" id="username" value="" placeholder="请输入用户名，可用作登录帐号" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;手机号：</span><input name="mobile" type="text" class="text reg_ico_2" id="mobile" value="" placeholder="请输入常用手机号，暂只支持中国大陆手机号" /> </dd>
								<dd><span class="span_l"> &nbsp;&nbsp;&nbsp;&nbsp;QQ：</span><input name="qq" type="text" class="text" id="qq" value="" /> </dd>
								<dd><span class="span_l"> &nbsp;&nbsp;&nbsp;&nbsp;旺旺：</span><input name="wangwang" type="text" class="text" id="wangwang" value="" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;登录密码：</span><input name="password" type="password" class="text " id="password" value="" placeholder="请输入字母，数字及符号" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;确认密码：</span><input name="password2" type="password" class="text " id="password2" value="" placeholder="请输入字母，数字及符号" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;手机验证码：</span><input name="mobilecode" type="text" class="text " id="mobilecode" value="" placeholder="请输入手机验证码" /> <a href="javascript:void(0)" onClick="ajaxSubmit()" class="getsns btn4">获取验证码</a></dd>
								<!--<dd class="tip_1"><span class="red">验证码已发送成功</span></dd>-->
								<dd>
									<span class="span_l"><font class="red">*</font>&nbsp;&nbsp;开通服务：</span>
									<label for="func_1"><input name="Yservice" type="checkbox" id="func_1" value="1" checked="checked" />YAHOO代拍</label>
									<label for="func_2"><input name="AService" type="checkbox" id="func_2" value="1" checked="checked" />日本代购</label>
									<label for="func_3"><input name="Tservice" type="checkbox" id="func_3" value="1" checked="checked" />日本转运</label>
								</dd>
								<dd>
									<span class="span_l"></span>
									<label for="func_1"><input name="isClause" type="checkbox" id="isClause" value="1" checked="checked" />我已阅读并同意《<a href = "javascript:void(0)" onClick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">17代购注册条例</a>》</label>
								</dd>
							</dl>
							<div class="clear20"></div>
							<div class="sure_btn_1">
								<input type="submit" value="立即注册" class="submit" />
                                <input type="hidden" name="t" value="y" />
						      <input name="typeid" type="hidden" id="typeid" value="1" />
							</div>
						</form>
						<div class="clear20"></div>
						<div class="clear20"></div>
					</div>
                    <%end if%>
                    
                    
                    
                    <%if request.QueryString("typeid")="2" then%>
                    <div>
						<div class="clear20"></div>
                        <p class="tip_2">手机短信验证暂不支持海外客户，给您造成的不便尽请谅解，请使用邮箱验证登录</p>
                        <form name="formcn" method="post" action="" onSubmit="return myjobchk();" class="reg_form_1">
							<dl>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;邮箱帐号：</span><input name="mail" type="text" class="text reg_ico_1" id="mail" value="" placeholder="请输入常用邮箱，可用作登录帐号" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;用户名：</span><input name="username" type="text" class="text reg_ico_2" id="username" value="" placeholder="请输入用户名，可用作登录帐号" /> </dd>
								<dd><span class="span_l"> &nbsp;&nbsp;&nbsp;&nbsp;QQ：</span><input name="qq" type="text" class="text" id="qq" value="" /> </dd>
								<dd><span class="span_l"> &nbsp;&nbsp;&nbsp;&nbsp;旺旺：</span><input name="wangwang" type="text" class="text" id="wangwang" value="" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;登录密码：</span><input name="password" type="password" class="text " id="password" value="" placeholder="请输入字母，数字及符号" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;确认密码：</span><input name="password2" type="password" class="text " id="password2" value="" placeholder="请输入字母，数字及符号" /> </dd>
								<dd><span class="span_l"><font class="red">*</font>&nbsp;&nbsp;邮箱验证码：</span><input name="mobilecode" type="text" class="text " id="mobilecode" value="" placeholder="请输入邮箱验证码" /> <a href="javascript:void(0)" onClick="ajaxSubmit()" class="getsns btn4">获取验证码</a></dd>
								<!--<dd class="tip_1"><span class="red">验证码已发送成功</span></dd>-->
								<dd>
									<span class="span_l"><font class="red">*</font>&nbsp;&nbsp;开通服务：</span>
									<label for="func_1"><input name="Yservice" type="checkbox" id="func_1" value="1" checked="checked" />YAHOO代拍</label>
									<label for="func_2"><input name="AService" type="checkbox" id="func_2" value="1" checked="checked" />日本代购</label>
									<label for="func_3"><input name="Tservice" type="checkbox" id="func_3" value="1" checked="checked" />日本转运</label>
								</dd>
								<dd>
									<span class="span_l"></span>
									<label for="func_1"><input name="isClause" type="checkbox" id="isClause" value="1" checked="checked" />我已阅读并同意《<a href = "javascript:void(0)" onClick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">17代购注册条例</a>》</label>
								</dd>
							</dl>
							<div class="clear20"></div>
						  <div class="sure_btn_1">
							  <input type="submit" value="立即注册" class="submit" />
                                <input type="hidden" name="t" value="y" />
					        <input name="typeid" type="hidden" id="typeid" value="2" />
							</div>
						</form>
						<div class="clear20"></div>
						<div class="clear20"></div>
					</div>
                    <%end if%>
                    
                    
                    
					
				</div>
				<div class="clear20"></div>
				<div class="clear20"></div>
			</div>
			
			
		</div>
		
		
		
	</div>
</div>

<div class="clear"></div>



<!--#include file="../common/footer.asp"-->

<div id="light" class="pop_contentx">
<h2><a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">关闭</a>17代购注册条例</h2>
<ul><%=HTMLEncode(web_Clause)%></ul>
</div> 
<div id="fade" class="pop_bgx"></div> 

</body>
</html>
<%
if request.Form("t")="y" then
mail=checkstr(inHTML(request.Form("mail")))
username=checkstr(inHTML(request.Form("username")))
mobile=checkstr(inHTML(request.Form("mobile")))
qq=checkstr(inHTML(request.Form("qq")))
wangwang=checkstr(inHTML(request.Form("wangwang")))
password=checkstr(inHTML(request.Form("password")))
password2=checkstr(inHTML(request.Form("password2")))
mobilecode=checkstr(inHTML(request.Form("mobilecode")))
Yservice=checkstr(inHTML(request.Form("Yservice")))
AService=checkstr(inHTML(request.Form("AService")))
Tservice=checkstr(inHTML(request.Form("Tservice")))
typeid=checkstr(inHTML(request.Form("typeid")))
returnurl=session("returnurl")
if Yservice="" then Yservice=0
if AService="" then AService=0
if Tservice="" then Tservice=0

if typeid="1" then
  if mail="" or username="" or mobile="" or password="" or password2="" or mobilecode="" or typeid="" then
  response.write"<script>alert('带星号不能为空');</script>"
  response.write"<script>window.history.back(-1);</script>"
  response.end
  end if
else
  if mail="" or username="" or password="" or password2="" or mobilecode="" or typeid="" then
  response.write"<script>alert('带星号不能为空');</script>"
  response.write"<script>window.history.back(-1);</script>"
  response.end
  end if
end if

if password<>password2 then
response.write"<script>alert('两次输入密码不一致');</script>"
response.write"<script>window.history.back(-1);</script>"
response.end
end if

if trim(session("mobileNum"))<>mobilecode then
response.write"<script>alert('验证码错误，请重写获取');</script>"
response.write"<script>window.history.back(-1);</script>"
response.end
end if

'当前最大会员id
Set rss=conn.execute("select max(id) from [user]") 
uid=rss(0)
if uid="" or isnull(uid)=true then uid=0

set rsx=server.createobject("adodb.recordset")
if typeid="1" then
  sql="select * from [user] where mail='"&mail&"' or username='"&username&"' or mobile='"&mobile&"'"
else
  sql="select * from [user] where mail='"&mail&"' or username='"&username&"'"
end if
rsx.open sql,conn,1,3
if not rsx.eof then
response.write"<script>alert('邮箱或用户名或手机已被使用，重新输入');</script>"
response.write"<script>window.history.back(-1);</script>"
response.end
else
rsx.addnew
rsx("uid")="U"&uid+1
rsx("mail")=mail
rsx("username")=username
rsx("mobile")=mobile
rsx("qq")=qq
rsx("wangwang")=wangwang
rsx("password")=md5(password)
rsx("Yservice")=Yservice
rsx("AService")=AService
rsx("Tservice")=Tservice
rsx("Tservice")=Tservice
rsx("typeid")=typeid
rsx.update
response.cookies("u")("mail")=rsx("mail")
response.cookies("u")("username")=rsx("username")
response.cookies("u")("Password")=rsx("Password")
response.cookies("u")("uid")=rsx("uid")
dim ctime
ctime=5256000
ctime=dateadd("n",ctime,now())
response.cookies("u").expires=ctime

if returnurl="" then
response.Redirect "/reg/success"
else
session("returnurl")=""
response.write"<script>window.location.href='"&returnurl&"';</script>"
end if

rsx.close
set rsx=nothing
end if
end if
%>



